how to handle background task in fast api